define([ "PDUtilDir/grid", "PDUtilDir/searchBlock" ],
		function(Grid, SearchBlock) {

			function init(cache, delObj, updateObj, searchObj) {
				// SearchBlock.init('OrderForVisitorSearchBlockId');
				// 初始化
				return Grid({
                    id : "OrderForVisitorProductGirdDivId",
                    pageSize : 10,
                    index : true,
                    multi : true,
                    pagination : true,
                    cache : false,
                    layout : [ {
                        name : "组织名称",
                        field : "agencyedDept",
                        sort : true,
                        click : function(e) {
                            updateObj.run(e.data.row);
                        }
                    }, {
                        name : "供应商",
                        field : "suplierName",
                        sort : true
                    }, {
                        name : "产品名称",
                        field : "product.name",
                        format: function (e) {
                            return e.row.product ? e.row.product.name : '未知';
                        }
                    }, {
                        name : "班期",
                        field : "hTimeTable.date",
                        format: function (e) {
                            return e.row.hTimeTable.date.replace("00:00:00", "");
                        }
                    }, {
                        name : "成本价格",
                        field : "totalCost",
                        sort : true
                    }, {
                        name : "外卖价格",
                        field : "totalSale",
                        sort : true
                    }, {
                        name : "创建人",
                        field : "creatUserName"
                    }, {
                        name : "创建时间",
                        field : "createTime"
                    } ],
                    toolbar : [
                        {
                            name : "查询",
                            icon : "fa fa-search",
                            callback : function(event) {
                                searchObj.run();
                            }
                        }/*, {
                            name : "添加",
                            icon : "fa fa-search",
                            callback : function(event) {
                                addSupport.run();
                            }
                        }*/, {
                            name : "删除",
                            icon : "fa fa-trash-o",
                            callback : function(event) {
                                delObj.run();
                            }
                        }
                    ],
                    data : {
                        type : "URL",
                        value : getServer()
                        + "/flea/hclv/productAgency/findPaging.htmls"
                    }
                });
			}
			return {
				init : init
			}
		});